package com.tuling.code.algorithm.loadbalance;

import com.tuling.code.algorithm.loadbalance.simple.LoadBlanceStragety;
import com.tuling.code.algorithm.loadbalance.simple.OrignSourceHash;
import com.tuling.code.algorithm.loadbalance.simple.Random;
import com.tuling.code.algorithm.loadbalance.simple.RoundRobin;
import com.tuling.code.algorithm.loadbalance.simple.WeightRandom;
import com.tuling.code.algorithm.loadbalance.simple.WeightRoundRobin;

public class ClientMain {
	public static void main(String[] args) {
		
		LoadBlanceStragety lb = null;
		
		//lb = new RoundRobin();
		
		//lb = new Random();
		
		//lb = new WeightRoundRobin();
		
		lb = new WeightRandom();
		
		for(int i = 0;i<20 ; i++){
			lb.getServer("");
		}
		
		
		/*lb = new OrignSourceHash();
		System.out.println(lb.getServer("192.168.0.1"));
		System.out.println(lb.getServer("192.168.0.1"));
		System.out.println(lb.getServer("192.168.0.1"));
		System.out.println(lb.getServer("192.168.0.1"));
		System.out.println(lb.getServer("192.168.0.1"));
		
		System.out.println(lb.getServer("192.168.0.5"));
		System.out.println(lb.getServer("192.168.0.5"));
		System.out.println(lb.getServer("192.168.0.5"));
		System.out.println(lb.getServer("192.168.0.5"));
		
		System.out.println(lb.getServer("192.168.0.101"));
		System.out.println(lb.getServer("192.168.0.101"));
		System.out.println(lb.getServer("192.168.0.101"));
		System.out.println(lb.getServer("192.168.0.101"));
		
		System.out.println(lb.getServer("192.168.2.2"));
		System.out.println(lb.getServer("192.168.2.2"));
		System.out.println(lb.getServer("192.168.2.2"));
		System.out.println(lb.getServer("192.168.2.2"));*/
	}
}
